﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Text.RegularExpressions;

namespace SLLottery.Common
{
    public class Common
    {
        static Regex reg = new Regex(@"^[a-zA-Z0-9_]+$");//英数，以及下划线
        static Regex reg_double = new Regex(@"^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$");// 正浮点数
        static  Regex reg_bankName = new Regex(@"^[a-zA-Z0-9_\u4e00-\u9fa5]+$");//汉字，英数，以及下划线
        static Regex reg_num = new Regex(@"^-?\d+$");
        public static bool ValidateInput(string value)
        {
            return reg.Match(value).Success;
        }
        public static bool ValidateUserID(string value)
        {
            return reg_bankName.Match(value).Success;
        }
        public static bool ValidateBetMoney(string value)
        {
            return reg_double.Match(value).Success;
        }
        public static bool ValidateBankName(string value)
        {
            return reg_bankName.Match(value).Success;
        }
        public static bool ValidateNums(string value)
        {
            return reg_num.Match(value).Success;
        }
    }
}

